<? $pro = getRecord("tbl_product", "id=".$_REQUEST['id']);?>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border_table">
	<tr  bgcolor="#F5F7FB" valign="middle">
	  <td align="center" style="padding-bottom:10px" valign="middle"><span class="text_pro"><b><?=$pro['name']?></b> </span></td>
  </tr>
	<tr>
	  <td align="center"><img src="<?=$pro['image_large']?>" border="0" /></td>
  </tr>
	<tr>
	  <td colspan="2" align="center" height="50">
			<?
			$sql1 = "select * from tbl_product_category where id=".$pro['parent']." ";
			$result1 = @mysql_query($sql1,$conn);
			$pro1=mysql_fetch_assoc($result1);
			?>
			<A href="./?frame=product_detail&id=<?=$pro['id'];?>">
				<IMG src="<?=$pro1['image']; ?>" height="50px" border=0/></A>
		  <DIV id=preview_div style="DISPLAY: none;  POSITION: absolute"></DIV>				  
	  </td>
	</tr>    
  
  <tr>
	  <td align="center" style="padding-bottom:10px; padding-top:10px">
	  	<?=_PRICE?> : <span class="red"><strong><?=$pro['price']?>&nbsp;GBP</strong></span></td>
  </tr>
  <? if($pro['subject']>0)
					{?>
					<tr><td align="center" style="padding-bottom:5px">
						 <!--?=$_lang=='vn' ? 'Giá khuyến mãi :' : 'Promotion Price : '?--> 
						 <span class="red"><strong><?=number_format($pro['subject'],0,',','.')?>&nbsp;GBP</strong></span>
					</td></tr>					
					<? }
					else {echo ''; }										
				?>			
  <tr>
	  <td align="center" style="padding-bottom:10px"><a href="./?frame=cart&p=<?=$pro['id']?>" class="buynow">
	  	<img src="images/cart.jpg" width="20" height="17" vspace="2" border="0" align="absmiddle" />&nbsp;&nbsp;Buy Now  &nbsp;</a></td>
	<tr>
		<td style="padding:10px;" align="justify">
			<?	
				$str=$pro1['detail_short'];
				 echo $str;
			?>
			
		</td>
	</tr>					

<br />
<?
$row = 5;
$col = 3;
$cat=0;
$p=0;

if ($_REQUEST['p']!='') $p=killInjection($_REQUEST['p']);

$sql = "select * from tbl_product where status=0 AND id<>'".$pro['id']."' AND parent=".$pro['parent']." order by sort,date_added desc limit ".$row*$col*$p.",".$row*$col;

$result = @mysql_query($sql,$conn);
$total = countRecord("tbl_product","status=0 AND id<>'".$pro['id']."' AND parent=".$pro['parent']);
if($total==0){
?>

<?
}else{
?>
<table width="98%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="line">&nbsp;</td>
  </tr>
   <tr>
    <td style="padding-top:10px"><span style="font-family:Tahoma; font-size:12px; color:#333333; padding-left:5px;padding-top:10px"><strong>Other Products : </strong></span></td>
  </tr>
</table>
<table cellspacing="4" cellpadding="0" width="100%" border="0">
<?
for($i=0; $i<$row; $i++){
?>
	<tr>			  
			
<?
	for($j=0; $j<$col&&$pro=mysql_fetch_assoc($result); $j++){				
			if($pro['image_large']!=''){
				$image=$pro['image_large'];
				}
				else{
				$image=$pro['image'];
				}
				$size = getimagesize($image);
				$height = $size[1]+50;
				$width = $size[0]+20;	
				?>
		<td class="border_table" valign="top">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="float:left">
				<tr>
				<td height="40" colspan="2" align="center" valign="middle"  bgcolor="#F5F7FB">
				  	<a href="./?frame=product_detail&id=<?=$pro['id']?>" class="text_pro"><?=$pro['name']?> </a>
				</td>
				</tr>
				<tr>
					<td style="padding:10px;" align="justify" height="79px">
						<?	
							$sql1 = "select * from tbl_product_category where id=".$pro['parent']." ";
							$result1 = @mysql_query($sql1,$conn);
							$pro1=mysql_fetch_assoc($result1); 
							$str=$pro1['detail_short'];
							 if(strlen($str)>160)
							 {
							 $str=substr($str,0,160);
							 }
							 echo $str .'...<br/><br/>';
							
						?>
					</td>
				</tr>
				<tr>
				  <td colspan="2" align="center" height="50px">
						<A href="./?frame=product_detail&id=<?=$pro['id'];?>">
							<IMG src="<?=$pro1['image']; ?>" width="60px" border=0/></A>
					  <DIV id=preview_div style="DISPLAY: none;  POSITION: absolute"></DIV>				  
				  </td>
				</tr>					
				<tr>	
				<tr>
				  <td height="25" colspan="2" align="center" valign="bottom"><?=_PRICE?>: <span class="red"><strong><?=$pro['price']?>&nbsp;GBP</strong></span> </td>
				</tr>
				<? if($pro['subject']!=0)
					{?>
					<tr><td align="center" style="padding:2px" colspan="2" height="25" valign="bottom">
						 <?=$_lang=='vn' ? 'Giá khuyến mãi :' : 'Promotion Price : '?> 
						 <span class="red"><strong><?=number_format($pro['subject'],0,',','.')?>&nbsp;GBP</strong></span>
					</td></tr>					
					<? }
					else {?>
						<tr><td align="center" style="padding:2px" colspan="2" height="25">&nbsp;</td></tr>
					<? }										
				?>				
				<tr>
				  <td align="center" height="30" style="padding-top:5px" valign="bottom" colspan="2"><a href="./?frame=cart&p=<?=$pro['id']?>" class="buynow">
				  	  <img src="images/cart.jpg" width="20" height="17" vspace="2" border="0" align="absmiddle" />&nbsp;&nbsp;Buy Now  &nbsp;&nbsp;</a>
					  &nbsp;&nbsp;<a href="./?frame=product_detail&id=<?=$pro['id']?>" class="buynow"><?=$_lang=='vn' ? 'More Info':'More Info'?> </a>	 </td>					 
				</tr>		
 			</table>				
            <?
}
while($j<$col){
	echo "";
	$j=$j+1;
}
?></td>
	</tr>	  	
<? }?>

</table>
<table width="98%" border="0">
 <tr><td class="line">&nbsp;</td></tr>
</table>
<table align="center" cellSpacing=0 cellPadding=0 width="98%" border=0>

<?
$newsPage       = $_lang=="vn" ? "Products" : "Products";
$pagePage       = $_lang=="vn" ? "Page" : "Page";
$titleFirst     = $_lang=="vn" ? "First" : "First";
$titlePrevious  = $_lang=="vn" ? "Previous" : "Previous";
$titleNext      = $_lang=="vn" ? "Next" : "Next";
$titleLast      = $_lang=="vn" ? "Last" : "Last";

$pages = countPages($total,$row*$col);
//echo $pages;
echo '<tr><td colspan="2" align="center"></td></tr>';
echo '<tr><td class="smallfont" align="left" style="padding-top:5px"><b>'.$total.'</b> '.$newsPage.'</td>';
echo '<td class="smallfont" align="right">'.$pagePage.' : ';
$param="";
if ($p>1) echo '<a class="aLink3" title="'.$titleFirst.'" href="./?frame='.$_REQUEST['frame'].'&id='.$_REQUEST['id'].$param.'&p=0">[&lt;&lt;]</a> ';
if ($p>0) echo '<a class="aLink3" title="'.$titlePrevious.'" href="./?frame='.$_REQUEST['frame'].'&id='.$_REQUEST['id'].$param.'&p='.($p-1).'">[&lt;]</a> ';
$from=($p-10>0?$p-10:0);
$to=($p+10<$pages?$p+10:$pages);
for ($i=$from;$i<$to;$i++){
	if ($i!=$p) echo '<a class="aLink3" href="./?frame='.$_REQUEST['frame'].'&id='.$_REQUEST['id'].$param.'&p='.$i.'">'.($i+1).' </a>';
	else echo '<span class="current">'.($i+1).'</span> ';
}
if ($p<$i-1) echo '<a class="aLink3" title="'.$titleNext.'" href="./?frame='.$_REQUEST['frame'].'&id='.$_REQUEST['id'].$param.'&p='.($p+1).'">[&gt;]</a> ';
if ($p<$pages-1) echo '<a class="aLink3" title="'.$titleLast.'" href="./?frame='.$_REQUEST['frame'].'&id='.$_REQUEST['id'].$param.'&p='.($pages-1).'">[&gt;&gt;]</a>'; 
echo '</td></tr>';
?>
</table><br />
 
<? }?> 
 